//
//  NewfeatureViewController.swift
//  weibo
//
//  Created by imac on 16/8/5.
//  Copyright © 2016年 gongyujie. All rights reserved.
//

import UIKit

class NewfeatureViewController: UIViewController, UIScrollViewDelegate {
    
    lazy var scollView: UIScrollView = {
        let sv = UIScrollView(frame: UIScreen.mainScreen().bounds)
        sv.delegate = self
        return sv
    }()
    
    override func loadView() {
        view = scollView
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        
        setScrollView()
        
        setPageControl()
    }
    
    func setScrollView(){
        let width = scollView.bounds.width
        let height = scollView.bounds.height
        
        
        let imageCount = 4
        for i in 1..<imageCount {
            let imageName = String(format: "new_feature_%d",i+1)
            let image = UIImage(named: imageName)
            let iv = UIImageView(image: image)
            
            iv.frame = CGRect(x: CGFloat(i) * width, y: 0, width: width, height: height)
            scollView.addSubview(iv)
        }
        
    }
    
    func setPageControl(){
    
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
